import { handleActions } from 'redux-actions'
import { signup, signup_fail, signup_reset, signup_success } from '../actions/signup'
const initiaState = {
    isLoading: false,
    isloaded: false,
    success:false,
    message: ""
}
const reducer = handleActions({
    [signup]: () => ({
        isLoading: true,
        isloaded: false,
        success: false,
        message: ""
    }),
    [signup_success]: () => ({
        isLoading: false,
        isloaded: true,
        success: true,
        message: ""
    }),
    [signup_fail]: (state,action) => ({
        isLoading: false,
        isloaded: true,
        success: false,
        message: action.payload.message
    }),
    [signup_reset]: () => ({
        isLoading: false,
        isloaded: false,
        success: false,
        message: ""
    }),
},initiaState)
export default reducer